<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin 2 - Register</title>

    <!-- Custom fonts for this template-->
    <link href="/static/store/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
          rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="/static/store/css/sb-admin-2.min.css" rel="stylesheet">

</head>

<body class="bg-gradient-primary">

<div class="container">

    <div class="card o-hidden border-0 shadow-lg my-5">
        <div class="card-body p-0">
            <!-- Nested Row within Card Body -->
            <div class="row">
                <div class="col-lg-5 d-none d-lg-block bg-register-image"></div>
                <div class="col-lg-7">
                    <div class="p-5">
                        <div class="text-center">
                            <h1 class="h4 text-gray-900 mb-4">注册</h1>
                        </div>
                        <form class="user" method="post">
                            {% csrf_token %}
                            <div class="form-group row">
                                <div class="col-sm-12 col-md-12">
                                    <input type="text" class="form-control form-control-user" id="exampleFirstName"
                                           placeholder="账号：" name="username">
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="email" class="form-control form-control-user" id="exampleInputEmail"
                                       placeholder="邮箱：" name="email">
                            </div>

                            <div class="form-group">
                                <input type="text" class="form-control form-control-user" id="phone" placeholder="手机号："
                                       name="phone">
                            </div>

                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <input type="text" class="form-control form-control-user" placeholder="短信验证码："
                                               name="code">
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <input type="button" class="btn btn-primary btn-user btn-block" id="getcode"
                                               value="获取验证码">
                                    </div>
                                </div>
                            </div>


                            <div class="form-group row">
                                <div class="col-sm-6 mb-3 mb-sm-0">
                                    <input type="password" class="form-control form-control-user"
                                           id="exampleInputPassword" placeholder="密码：" name="password">
                                </div>
                                <div class="col-sm-6">
                                    <input type="password" class="form-control form-control-user"
                                           id="exampleRepeatPassword" placeholder="确认密码：" name="repassword">
                                </div>
                            </div>
                            <input type="submit" class="btn btn-primary btn-user btn-block" value="注册账号">
                        </form>
                        <hr>
                        <div class="text-center">
                            <a class="small" href="#">忘记密码？</a>
                        </div>
                        <div class="text-center">
                            <a class="small" href="/store/login/">登陆</a>
                        </div>
                        <div class="col-sm-12 col-md-12 text-center">
                            {{ message }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<!-- Bootstrap core JavaScript-->
<script src="/static/store/vendor/jquery/jquery.min.js"></script>
<script src="/static/store/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Core plugin JavaScript-->
<script src="/static/store/vendor/jquery-easing/jquery.easing.min.js"></script>

<!-- Custom scripts for all pages-->
<script src="/static/store/js/sb-admin-2.min.js"></script>
<script>
    $("#getcode").click(
        function () {
            {#console.log(222)#}
            var phone = $("#phone").val();
            var url = "/store/getcode/?phone=" + phone;
            $.ajax({
                url: url,
                type: "get",
                data: "",
                success: function (data) {
                    console.log(data)
                },
                error: function (error) {
                    console.log(error)
                }
            })
        }
    )
</script>

</body>

</html>
